import '../video_model.dart';

class AllModule {
  List<AllModuleAllSection>? allSection;
  String? id;
  String? name;

  AllModule({
    this.allSection,
    this.id,
    this.name,
  });

  AllModule.fromJson(Map<String, dynamic> json) {
    allSection =
    json["allSection"] == null ? [] : List<AllModuleAllSection>.from(json["allSection"]!.map((x) => AllModuleAllSection.fromJson(x)));
    id = json["id"];
    name = json["name"];
  }

  Map<String, dynamic> toJson() => {
    "allSection": allSection == null ? [] : List<dynamic>.from(allSection!.map((x) => x.toJson())),
    "id": id,
    "name": name,
  };
}

class AllModuleAllSection {
  List<AllTag>? allTags;
  String? id;
  String? mid;
  String? name;

  AllModuleAllSection({
    this.allTags,
    this.id,
    this.mid,
    this.name,
  });

  AllModuleAllSection.fromJson(Map<String, dynamic> json) {
    allTags = json["allTags"] == null ? [] : List<AllTag>.from(json["allTags"]!.map((x) => AllTag.fromJson(x)));
    id = json["id"];
    mid = json["mid"];
    name = json["name"];
  }

  Map<String, dynamic> toJson() => {
    "allTags": allTags == null ? [] : List<dynamic>.from(allTags!.map((x) => x.toJson())),
    "id": id,
    "mid": mid,
    "name": name,
  };
}

class AllTag  {
  String? coverImg;
  String? hotMark;
  String? id;
  String? tagName;
  int? videoCount;
  String? backgroundImg;
  String? description;
  bool? hasCollected;
  String? name;

  /// 针对圈子新增字段 1 是普通圈子 2 楼凤 3nut分享 原味店铺
  int? type;
  List<VideoModel>? allVideoInfo;
  AllTag({
    this.coverImg,
    this.hotMark,
    this.id,
    this.tagName,
    this.videoCount,
    this.type,
  });


  AllTag.fromJson(Map<String, dynamic>? json) {
    json ??= {};
    coverImg = json["coverImg"];
    hotMark = json["hotMark"];
    id = json["id"];
    tagName = json["tagName"];
    videoCount = json["videoCount"];
    type = json['type'];
    backgroundImg = json['backgroundImg'];
    description = json['description'];
    hasCollected = json['hasCollected'];
    name = json['name'];
    if (json["allVideoInfo"] is List) {
      allVideoInfo = (json["allVideoInfo"] as List).map((e) => VideoModel.fromJson(e)).toList();
    }
  }

  Map<String, dynamic> toJson() =>
      {"coverImg": coverImg, "hotMark": hotMark, "id": id, "tagName": tagName, "videoCount": videoCount, 'type': type};
}